package com.shadow.mall.wms.controller;

import com.shadow.mall.common.core.JsonResult;
import com.shadow.mall.wms.api.WmsApi;
import com.shadow.mall.wms.domain.PickDTO;
import com.shadow.mall.wms.domain.PickGoodsRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wms")
@Slf4j
public class WmsController {

    @Autowired
    WmsApi wmsApi;

    @RequestMapping("/pickGoods")
    public JsonResult<PickDTO> pickGoods(@RequestBody PickGoodsRequest request){
        log.info("远程调用 pickGoods");
       return wmsApi.pickGoods(request);
    }


    @RequestMapping("/cancelPickGoods")
    public JsonResult<Boolean> cancelPickGoods(@RequestBody String orderId){
        log.info("远程调用 cancelPickGoods");
        return wmsApi.cancelPickGoods(orderId);
    }
}
